package com.luatos.airtun.ws;

import javax.websocket.MessageHandler;

import org.nutz.lang.Lang;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.plugins.mvc.websocket.handler.AbstractWsHandler;

public class EchoWsHandler2 extends AbstractWsHandler implements MessageHandler.Whole<byte[]> {
	
	private static final Log log = Logs.get();

	public EchoWsHandler2() {
		super("");
	}

	@Override
	public void onMessage(byte[] message) {
		log.info("收到数据 " + Lang.fixedHexString(message));
		endpoint.sendBinary(session.getId(), message);
	}
}
